﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CMSMVC4.Areas.Main.Controllers
{
    public class ChangeLanguageController : Controller
    {
        //
        // GET: /Main/ChangeLanguage/

        public ActionResult ChangeLanguage(string culture, string returnUrl)
        {
            return JavaScript("developing!");
            //CMSMVC4Entities db = new CMSMVC4Entities();
            //var row = db.Languages.FirstOrDefault(x => x.Code.Equals(culture));
            //if (row != null)
            //{
            //    var httpCookie = Request.Cookies["language"];
            //    if (httpCookie != null)
            //    {
            //        var cookie = Response.Cookies["language"];
            //        if (cookie != null) cookie.Value = culture;
            //    }
            //}
            //if (!string.IsNullOrEmpty(returnUrl))
            //{
            //    return Redirect(returnUrl);
            //}
            //return RedirectToAction("Index","Home");
        }

    }
}
